package com.springboot.cloud.sysadmin.organization.entity.form;

import com.springboot.cloud.common.web.entity.form.BaseForm;
import com.springboot.cloud.sysadmin.organization.entity.po.Role;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by ZengJian on 2021/2/3 0003 上午 9:22
 */
@ApiModel
@Data
public class RoleForm extends BaseForm<Role> {

    @NotBlank(message = "角色编码不能为空")
    @ApiModelProperty(value = "角色编码")
    private String code;

    @NotBlank(message = "角色名称不能为空")
    @ApiModelProperty(value = "角色名称")
    private String name;

    @ApiModelProperty(value = "数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）")
    private String dataScope;

    @ApiModelProperty(value = "显示顺序")
    private int roleSort;

    @ApiModelProperty(value = "菜单树选择项是否关联显示")
    private boolean resourceCheckStrictly;

    @ApiModelProperty(value = "部门树选择项是否关联显示")
    private boolean deptCheckStrictly;

    @ApiModelProperty(value = "角色描述")
    private String description;

    @ApiModelProperty(value = "是否删除")
    private String deleted = "N";

    @ApiModelProperty(value = "角色拥有的数据权限的部门列表")
    private Set<String> depts = new HashSet<String>();

    @ApiModelProperty(value = "角色拥有的资源权限的资源列表")
    private Set<String> resources = new HashSet<String>();

    @ApiModelProperty(value = "角色状态，true为可用")
    private Boolean enabled;

    @ApiModelProperty(value = "角色拥有的资源id列表")
    private Set<String> resourceIds;

}
